# 元组和集合
# 元组的创建
tuple_01 = ('a','b',1,2,3)
tuple_02 = 'a','b',1,2,3
# print(tuple_02)
# print(tuple_01)
tuple_03 = ()
# print(tuple_03)
list_01 = [1]
# print(list_01)
tuple_04 = (1,)
item_01 = (1)
# print(tuple_04)
# print(item_01)
list_02 = ['aaa','bbb','ccc',1,2,3,1,2,3]
list_03 = ['aaa','bbb','ccc',1,2,3,["111","222"]]
tuple_05 = tuple(list_02)
tuple_06 = tuple(list_03)
# print(tuple_06)
# print(list_02)
# print(tuple_05)

# 访问元组
# print(tuple_06[5])
# # print(tuple_06[6][0])

# 元组的合并和遍历
tuple_07 = tuple_01 + tuple_02
# print(tuple_07)
# print(tuple_01)
# print(tuple_02)

# 遍历
# for i in tuple_06:
#     print(i)
# j = 0
# print(len(tuple_06))
# while j < len(tuple_06):
#     print(tuple_06[j])
#     j += 1

# 集合
set_01 = {'a','b','c',1,2,3}
set_02 = set(tuple_07)
set_03 = set(list_02)
# set_04 = set(list_03)  # list_03有嵌套列表，不能转成集合，会报错
# print(set_01)
# print(set_02)
# print(set_03)
# print(set_04)

# 基本操作
set_04 = {'a','b','c',1,2,3,4,5}
set_05 = {'aa','bb','111',112,113,114}
# print(set_04)
# print(set_05)
# set_04.add('aa')
# print(set_04)
# set_04.update(set_05)
# print(set_04)
# item_02 = set_04.pop()
# print(set_04)
# print(item_02)
# set_04.remove(3)
# print(set_04)
# # set_04.remove('bbb')  # set_04不包含元素bbb，使用remove方法删除会报错
# # print(set_04)
# set_04.discard(3)
# print(set_04)
# # set_04.discard('bbb')  # set_04不包含元素bbb，使用discard方法删除不会报错
# # print(set_04)
# set_04.clear()
# print(set_04)
# # item_03 = set_04.pop()  # 使用pop方法删除空集合中的元素，会报错
# # print(item_03)
# # print(set_04)

# set_06 = {12,56,78,64,34,79,46,54,13}
# item_04 = len(set_04)
# print(item_04)
# # item_05 = max(set_04)  # 集合中的数据类型不一致时，无法比较，不能使用max，min，sorted
# item_05 = max(set_06)
# item_06 = min(set_06)
# print(item_05)
# print(item_06)
# item_07 = sorted(set_06)
# print(item_07)

set_07 = {'a','b',1,2,3}
set_08 = {1,2,4}
set_09 = {1,2}
# print(set_07 & set_08)
# print(set_07 | set_08)
# print(set_07 - set_08)
# print(set_07 ^ set_08)
# print(set_09 <= set_08)
# print(set_09 <= set_09)
# print(set_08 <= set_07)
# print(set_08 >= set_07)
# print(set_08 >= set_09)
# print(set_08 >= set_08)
